from sqlalchemy import String, Text, Column, DateTime, Integer
from config.database import Base


class PlantTask(Base):
    """
    种植任务明细表
    """

    __tablename__ = 'plant_task'

    task_id = Column(Integer, primary_key=True, nullable=False, comment='任务Id')
    task_name = Column(String(255), nullable=True, comment='任务名称')
    task_leader_id = Column(Integer, nullable=True, comment='责任人Id')
    task_type = Column(String(255), nullable=True, comment='任务类型')
    task_leader = Column(String(255), nullable=True, comment='责任人')
    scheduled_start_time = Column(DateTime, nullable=True, comment='计划开始时间')
    scheduled_end_time = Column(DateTime, nullable=True, comment='计划结束时间')
    actual_start_time = Column(DateTime, nullable=True, comment='实际开始时间')
    actual_end_time = Column(DateTime, nullable=True, comment='实际结束时间')
    task_description = Column(Text, nullable=True, comment='任务详情')
    plant_plot_id = Column(Integer, nullable=True, comment='关联地块id')
    plant_plot_name = Column(String(255), nullable=True, comment='关联地块')
    planter_id = Column(Integer, nullable=True, comment='种植主体Id')
    planter_name = Column(String(255), nullable=True, comment='种植主体')
    product_area_id = Column(Integer, nullable=True, comment='产区id')
    product_area_name = Column(String(255), nullable=True, comment='产区')
    year = Column(Integer, nullable=True, comment='数据年份')
    is_ontime = Column(Integer, nullable=True, comment='是否按时完成')



